//
//  WonderfulNumber.m
//  TextApp
//
//  Created by Tim Isted on 09/09/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "WonderfulNumber.h"


@implementation WonderfulNumber

- (id)init
{
	return [self initWithNumber:42];
}

- (id)initWithNumber:(float)newNumber
{
	[super init];
	
	storedNumber = newNumber;
	
	NSLog(@"A WonderfulNumber object was initialized!");
	
	return self;
}

+ (id)wonderfulNumberWithFloat:(float)newNumber
{
	id numberToReturn = [[self alloc] initWithNumber:newNumber];
	
	return [numberToReturn autorelease];
}

- (void)dealloc
{
	NSLog(@"A WonderfulNumber object was deallocated!");
	
	[super dealloc];
}

- (NSString *)storedNumberAsString
{
	NSString *stringToReturn = [NSString stringWithFormat:@"%f", storedNumber];
	
	return stringToReturn;
}

- (void)setStoredNumber:(float)newNumber
{
	storedNumber = newNumber;
}

- (float)storedNumber
{
	return storedNumber;
}

@end
